package com.es.service.impl;

import com.es.domain.Student;
import com.es.entity.StudentDO;
import com.es.mapper.StudentMapper;
import com.es.service.StudentServiceI;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * 描述:
 * es-meta-
 *
 * @author Derek
 * @create 2021-11-30 10:37
 */
@Service
public class StudentServiceImpl implements StudentServiceI {
    @Autowired
    private StudentMapper mapper;


    @Override
    public List<Student> list() {
        List<StudentDO> doList = mapper.list();
        List<Student> list = new ArrayList<>();
        doList.forEach(e->{
            Student s = new Student();
            BeanUtils.copyProperties(e,s);
            list.add(s);
        });
        return list;
    }
}
